import * as sdk from './fetch';

const controllerName = 'prizesController';

/**
 *
 * 获取转盘抽奖奖项
 *
 */
async function showPrizeItemApi() {
  let result = await sdk.post('/luckDraw/showPrize', {});
  return result;
}

/**
 *
 * 去抽奖
 *
 */
async function goToTheLotteryApi() {
  let result = await sdk.post('/luckDraw/drawPrize', {});
  return result;
}

/**
 *
 * 获取活动规则
 *
 */
async function getTurntableActivityApi() {
  let result = await sdk.post(`//turntableactivity/activityRegulation`, {});
  return result;
}

/**
 *
 * 获取中奖公告
 *
 */
async function getWinningAnnouncementApi() {
  let result = await sdk.post('/myreward/prize/rotation', {});
  return result;
}

/**
 *
 * 获取我的奖励
 *
 */
async function getMyRewardApi(params) {
  let result = await sdk.post('/myreward/page', params);
  return result;
}

export default {
  goToTheLotteryApi,
  showPrizeItemApi,
  getTurntableActivityApi,
  getWinningAnnouncementApi,
  getMyRewardApi,
};

export type IFindByIdAddressIdReq = string;

export interface IGetListListReqReq {
  turntableActivityId: number | string;
}
